package com.bdqn.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bdqn.mapper.RoleMapper;
import com.bdqn.pojo.Right;
import com.bdqn.pojo.Role;
import com.bdqn.service.RoleService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.awt.print.Pageable;
import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Resource
    private RoleMapper roleMapper;

    @Override
    public List<Role> list() {
        return roleMapper.list();
    }

    @Override
    public List<Right> findAllRights() {
        return roleMapper.findAllRights();
    }

    @Override
    public List<Role> findAllRoles() {
        return roleMapper.list();
    }

    @Override
    public void deleteRoleById(long role) {
        roleMapper.deleteRoleById(role);
    }

    @Override
    public void deleteRole(String roleName) {
        roleMapper.deleteRole(roleName);
    }

    @Override
    public Page<Role> findRole(String roleName, Pageable pageable) {
        return findRole(roleName,pageable);
    }

//    @Override
//    public List<Right> findRightsByRole(Role role) {
//        return roleMapper.list(role);
//    }
}
